package com.hk.service.yingmi.impl;

import com.hk.commons.entity.yingmi.YingmiApiEvent;
import com.hk.dao.base.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


@Service
public class YingmiApiRepository extends BaseServiceImpl<YingmiApiEvent> {

    private static final int poolNum = 10;

    private static final ExecutorService executor = Executors.newFixedThreadPool(poolNum);

    public void store(String httpWay, String path, String params, String result) {

        executor.execute(() -> {

            YingmiApiEvent event = new YingmiApiEvent(httpWay, path, params, result);
            super.save(event);

        });

    }

}
